package com.punai.prodatalibrary.constants;

import java.util.ArrayList;
import java.util.List;

public class ProjectLibConstants {

    public enum PRO_TYPE{
        /**
         * 父项目
         */
        F("父","1"),
        /**
         * 子项目
         */
        Z("子","2"),
        /**
         * 工区项目
         */
        G("工区","3");

        private String desc;
        private String code;

        PRO_TYPE(String desc,String code) {
            this.desc = desc;
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }

    /**
     * 通用Y/N
     */
    public static final String CBZB_RELEASE_TYPE = "CB";
    public static final String SRZB_RELEASE_TYPE = "SR";

    public enum Cost_TYPE{

        LWFB(1,"劳务分包"),
        ZYFB(8,"专业分包"),
        CLF(2,"材料费"),
        ZZCLF(3,"周转材料费"),
        JXF(4,"机械费"),
        AQWMSGF(5,"安全文明施工费"),
        LSSSF(6,"临时设施费"),
        QTCSF(13,"其他措施费"),
        GLF(7,"管理费");

        private Integer code;
        private String desc;

        Cost_TYPE(Integer code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(Integer code) {
            for (Cost_TYPE value : values()) {
                if (value.getCode().equals(String.valueOf(code))){
                    return value.getDesc();
                }
            }
            return null;
        }

        public static List<Integer> getCodeList() {
            List<Integer> res = new ArrayList<>();
            for (Cost_TYPE value : values()) {
                res.add(value.getCode());
            }
            return res;
        }
    }
}
